/**
 * 
 */
package travibot.engine;

/**
 * @author Petr Macek
 * 
 */
public interface Task extends Comparable<Task> {

    /**
     * Type of the task. Queued tasks are executed immediately after the
     * specified time delay. The strategy of execution is FIFO. Scheduled task
     * is scheduled to run on specified time and if there is normal queued task
     * the scheduled one will take precedence.
     * 
     * @author Petr Macek
     * 
     */
    enum Type {
        QUEUED_TASK, SCHEDULED_TASK
    }
    
    enum ExecutionResult {
        SUCCESS, FAILURE
    }

    /**
     * Executes the task. The behavior is polymorfic.
     */
    ExecutionResult execute() throws InterruptedException;

    /**
     * Gets the type of the task.
     * 
     * @return
     */
    Type getType();

}
